package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the TT_PERS_NATU_TITU database table.
 * 
 */
@Embeddable
public class TtPersNatuTituPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private String coRegiPres;
	private String coOficRgstPres;
	private String aaHojaPres;
	private String nuHojaPres;
	private String coActoRgst;
	private long nsAfec;
	private long nsPersNatu;

    public TtPersNatuTituPK() {
    }

	@Column(name="CO_REGI_PRES", unique=true, nullable=false, length=2)
	public String getCoRegiPres() {
		return this.coRegiPres;
	}
	public void setCoRegiPres(String coRegiPres) {
		this.coRegiPres = coRegiPres;
	}

	@Column(name="CO_OFIC_RGST_PRES", unique=true, nullable=false, length=2)
	public String getCoOficRgstPres() {
		return this.coOficRgstPres;
	}
	public void setCoOficRgstPres(String coOficRgstPres) {
		this.coOficRgstPres = coOficRgstPres;
	}

	@Column(name="AA_HOJA_PRES", unique=true, nullable=false, length=4)
	public String getAaHojaPres() {
		return this.aaHojaPres;
	}
	public void setAaHojaPres(String aaHojaPres) {
		this.aaHojaPres = aaHojaPres;
	}

	@Column(name="NU_HOJA_PRES", unique=true, nullable=false, length=8)
	public String getNuHojaPres() {
		return this.nuHojaPres;
	}
	public void setNuHojaPres(String nuHojaPres) {
		this.nuHojaPres = nuHojaPres;
	}

	@Column(name="CO_ACTO_RGST", unique=true, nullable=false, length=5)
	public String getCoActoRgst() {
		return this.coActoRgst;
	}
	public void setCoActoRgst(String coActoRgst) {
		this.coActoRgst = coActoRgst;
	}

	@Column(name="NS_AFEC", unique=true, nullable=false, precision=38)
	public long getNsAfec() {
		return this.nsAfec;
	}
	public void setNsAfec(long nsAfec) {
		this.nsAfec = nsAfec;
	}

	@Column(name="NS_PERS_NATU", unique=true, nullable=false, precision=38)
	public long getNsPersNatu() {
		return this.nsPersNatu;
	}
	public void setNsPersNatu(long nsPersNatu) {
		this.nsPersNatu = nsPersNatu;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof TtPersNatuTituPK)) {
			return false;
		}
		TtPersNatuTituPK castOther = (TtPersNatuTituPK)other;
		return 
			this.coRegiPres.equals(castOther.coRegiPres)
			&& this.coOficRgstPres.equals(castOther.coOficRgstPres)
			&& this.aaHojaPres.equals(castOther.aaHojaPres)
			&& this.nuHojaPres.equals(castOther.nuHojaPres)
			&& this.coActoRgst.equals(castOther.coActoRgst)
			&& (this.nsAfec == castOther.nsAfec)
			&& (this.nsPersNatu == castOther.nsPersNatu);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.coRegiPres.hashCode();
		hash = hash * prime + this.coOficRgstPres.hashCode();
		hash = hash * prime + this.aaHojaPres.hashCode();
		hash = hash * prime + this.nuHojaPres.hashCode();
		hash = hash * prime + this.coActoRgst.hashCode();
		hash = hash * prime + ((int) (this.nsAfec ^ (this.nsAfec >>> 32)));
		hash = hash * prime + ((int) (this.nsPersNatu ^ (this.nsPersNatu >>> 32)));
		
		return hash;
    }
}